/*
 * @Description: 导入按钮
 * @Author: Rfan
 * @Date: 2023-02-08 10:25:04
 * @LastEditTime: 2023-02-08 15:13:12
 */

import { useMemo, useState } from 'react';
import { Button } from 'antd';
import ImportArchivesDialog from '../dialogs/ImportArchives';

const ImportArchivesBtn = (props: any) => {
  const { baseInfo } = props;
  const [visible, setVisible] = useState(false);

  return (
    <>
      <Button type="text" size="small" onClick={() => setVisible(true)}>
        导入
      </Button>
      {useMemo(
        () => (
          <ImportArchivesDialog
            visible={visible}
            baseInfo={baseInfo}
            onClose={() => {
              setVisible(false);
            }}
          />
        ),
        [visible, baseInfo]
      )}
    </>
  );
};
export default ImportArchivesBtn;
